<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <!-- 剩余参数: ...restPrams会接收到剩余的参数，放在数组中 -->
  <script>
    function test(a, b, c, ...restParams) {
      console.log('a, b  ----->  ', a, b, restParams);
    }

    test(11, 2, 3, 4)
    test(11, 2, 3, 4, 6, 7)

    // 剩余属性: {...restPrasm} 会把剩余未解构的属性，组装成一个新的对象
    const zs = { name: "zs", age: 18, gender: "男", hobby: "爬山" }
    const { name, age, ...restParams } = zs
    console.log('restParams  ----->  ', restParams);

  </script>

</body>

</html>